Improve strategy plugin consumption notifications#107
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6c9ac5769
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| localized = _optional_string(notification_messages.get(default_locale)) | ||
| if localized: | ||
| return localized | ||
| if localized: |
There was a problem hiding this comment.
Guard the notification fallback before using localized
When a signal includes a notification object that does not contain a localized_messages mapping, this branch reaches if localized without ever assigning localized, so extract_strategy_plugin_localized_message(..., section="notification", locale=...) and therefore build_strategy_plugin_notification_lines(..., locale=...) raise UnboundLocalError instead of falling back to the generic plugin line. This affects artifacts that carry notification metadata but no localized notification copy.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbefff174d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if translator is not None: | ||
| consumption_line = _strategy_plugin_consumption_notification_line(signal, translator=translator) | ||
| if consumption_line: | ||
| lines.append(consumption_line) |
There was a problem hiding this comment.
Append consumption lines for locale-only notifications
When a signal carries localized_messages.notification and the caller uses the documented locale-only path (build_strategy_plugin_notification_lines(signals, locale="zh-CN") in docs/strategy_plugin_runtime_contract.md), translator is None, so this guard suppresses the new consumption line entirely. Auto-consumed, review-only, or not-applied localized artifacts then return only the artifact text while non-localized artifacts still get the consumption status later in the function, leaving users without the key position-consumption disclosure.
Useful? React with 👍 / 👎.
Summary
Validation